<!Doctype html>
<html>
<head>
    <meta charset='UTF-8'>
    <title>Document</title>
</head>
<body>
x轴：<span>0</span>
y轴：<span>0</span>
</body>
<script>
var spans = document.querySelectorAll("span");
document.onmousemove = function(e){
    var e = e || window.event;
    var x = e.clientX;
    var y = e.clientY;
    spans[0].innerText = x;
    spans[1].innerText = y;
}
</script>
</html>